
public class ISTree extends Tree<Integer, String> {

	public ISTree(int nodeDesc) {
		super(nodeDesc);
	}
	
	int sum(String name) {
		int sum = 0;
		TreeIteratorInterface<Tree<Integer, String>, Integer, String> nit = getNodeIterator();
		TreeIteratorInterface<String, Integer, String> eit = getEdgeIterator();
		while(nit.hasNext()) {
			Tree<Integer, String> node = nit.next();
			String edge = eit.next();
			if (edge.equals(name))
				sum += node.getNodeDesc();
		}
		return sum;
	}

}
